Skip to content

fix: propagate storage errors instead of returning empty site#238

Merged
yumike merged 1 commit into
mainfrom
fix/propagate-storage-errors
Mar 24, 2026
Merged

fix: propagate storage errors instead of returning empty site#238
yumike merged 1 commit into
mainfrom
fix/propagate-storage-errors

Conversation

@yumike
Copy link
Copy Markdown
Collaborator

@yumike yumike commented Mar 24, 2026

Summary

  • S3 storage errors (misconfigured bucket, network failures) now propagate as proper errors instead of being silently swallowed and returning an empty site
  • Initial load failures surface as error responses (503 from HTTP server, thrown errors from napi bindings) so operators can diagnose configuration issues
  • Subsequent reload failures log a warning and keep serving stale data, avoiding downtime from transient errors
  • Added RenderError::Storage and HandlerError::Storage variants for proper error typing through the stack

Test plan

  • Unit tests for MockStorage::with_scan_error() / set_scan_error()
  • Unit tests for initial load error propagation through reload_if_needed, navigation, render, has_page
  • Unit test for stale-data preservation on subsequent reload failure
  • Unit test for HandlerError::Storage returning 503
  • All existing tests pass (cargo test -p rw-site -p rw-storage -p rw-server)

🤖 Generated with Claude Code

S3 storage errors (misconfigured bucket, network failures) now propagate
as proper errors instead of being silently swallowed and returning an
empty site. Initial load failures surface as error responses (503 from
HTTP server, thrown errors from napi bindings). Subsequent reload failures
log a warning and keep serving stale data, avoiding downtime from
transient errors.

Fixes #237

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yumike yumike force-pushed the fix/propagate-storage-errors branch from 01e869c to 12b76b8 Compare March 24, 2026 10:25
@yumike yumike merged commit a189df1 into main Mar 24, 2026
18 checks passed
@yumike yumike deleted the fix/propagate-storage-errors branch March 24, 2026 10:43
yumike added a commit to rwdocs/backstage-plugins that referenced this pull request Mar 24, 2026
Adopt changes from rwdocs/rw#238 where getNavigation() now throws on
storage errors and renderPage() surfaces a distinct Storage error variant.
Previously, misconfigured S3 or network failures would silently return
empty navigation — now they propagate as ServiceUnavailableError (503).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yumike added a commit to rwdocs/backstage-plugins that referenced this pull request Mar 24, 2026
Adopt changes from rwdocs/rw#238 where getNavigation() now throws on
storage errors and renderPage() surfaces a distinct Storage error variant.
Previously, misconfigured S3 or network failures would silently return
empty navigation — now they propagate as ServiceUnavailableError (503).

Also bumps @rwdocs/core and @rwdocs/viewer to ^0.1.19.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yumike added a commit to rwdocs/backstage-plugins that referenced this pull request Mar 24, 2026
Adopt changes from rwdocs/rw#238 where getNavigation() now throws on
storage errors and renderPage() surfaces a distinct Storage error variant.
Previously, misconfigured S3 or network failures would silently return
empty navigation — now they propagate as ServiceUnavailableError (503).

Also bumps @rwdocs/core and @rwdocs/viewer to ^0.1.19.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant